package com.lkm.app_ui.m.Imple.hsj522;

import com.lkm.javatool.NumberHelp;



public class SendLoadKeyTask extends AbsCMDSendTask<Void, Void> {

    private byte[] key;

    public SendLoadKeyTask(CardCircuitComSe cardCircuitCom, byte[] key) {
        super(cardCircuitCom, SendLoadKeyTask.class.getName(), !true);
        this.key = key;
    }

    @Override
    protected void receiveResult(ReadResponEntity respon, int requestContinueSendCount) {
        if (respon != null && respon.isSuccess()) {
            complete( new InnerResponEntity<Void>().success(null, ""));
        } else {
            complete(new InnerResponEntity<Void>().fail(null, ""));
        }

    }

    @Override
    protected CMDWriteData createDataEntity(int requestContinueSendCount) {
        return new CMDWriteData() {
            @Override
            public byte[] getData() {
                return key;
            }

            @Override
            public byte getCmd() {
                return 0x20;
            }
        };
    }


}
